// Hello World.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>


	int NumberCheck(int r) {
		using namespace std; //required
		int a; // Input from user

		while(true){
			cin >> a; // this is what they type
			while((a!=r) || (a=r)) {
				if(a>r) {
					cout << "Your number is too high! Guess again!" << endl;
					break;
				} else if (a<r) {
					cout << "Your number is too low! Guess again!" << endl;
					break;
				} else {
					cout << "you won the GUESSING GAME!" << endl;
					return 0;
				}
			}
		}
	}

	int main() {
		using namespace std; //required

		srand( time(NULL) );
		int r = rand() % 10 + 1; // Random number generated at beginning of game

	    cout << "Welcome to the GUESSING GAME!" << endl;
		cout << "" << endl;
		cout << "Please Start with your first Guess: (press <enter> after you type your guess)" << endl;

		NumberCheck(r); //go check it

	    return 0;
	}